
import java.awt.Point;


/**
 * Ősosztály, amely az összes, a j�t�kban szerepl� egys�g �soszt�ly�ul szolg�l.
 */
public class Entity extends Observable
{

  protected Field field;
  protected boolean alive = true;
  public Integer ID = SkeletonHelper.GetObjectID();


  public Entity()
  {

  }

  public void callObservers()
  {
    if(!observers.isEmpty())
    {
      for(int i = 0;i<observers.size();i++)
      {
        ((IObserver)observers.get(i)).update();
      }
    }
  }

  public void setAlive(boolean alive)
  {
    callObservers();
    this.alive = alive;
  }

  public Point getPos()
  {
    return field.getGame().getPos(field);
  }

  public boolean isAlive()
  {
    return alive;
  }

  public boolean explode()
  {
    callObservers();
    return false;
  }

  public boolean dig()
  {
    callObservers();
    return false;
  }

  public boolean kill()
  {
    callObservers();
    return false;
  }

  public boolean eat()
  {
    callObservers();
    return false;
  }

  public boolean move(int direction, int depth)
  {
    callObservers();
    return false;
  }

  public boolean isRound()
  {
    return false;
  }

  public void activate()
  {
  }

  public void setField(Field field)
  {
    this.field = field;
  }

  public String toString()
  {
    return "Entity["+ID+"]";
  }
}